package com.sky.context;

public class BaseContext {
    private static final ThreadLocal<Long> threadLocal = new ThreadLocal<>(); // 每个线程中，使用的都是不同的变量，互不干扰

    public static void setCurrentId(Long value) {
        threadLocal.set(value);
    }

    public static Long getId() {
        return threadLocal.get();
    }

    public static void removeId() {
        threadLocal.remove();
    }
}
